export var hasCellSelected = function hasCellSelected(flowGraph) {
  return flowGraph.getSelectedCellCount() > 0;
};
export var hasNodeSelected = function hasNodeSelected(flowGraph) {
  return flowGraph.getSelectedCells().filter(function (cell) {
    return cell.isNode();
  }).length > 0;
};
export var hasEdgeSelected = function hasEdgeSelected(flowGraph) {
  return flowGraph.getSelectedCells().filter(function (cell) {
    return cell.isEdge();
  }).length > 0;
};
export var getSelectedNodes = function getSelectedNodes(flowGraph) {
  return flowGraph.getSelectedCells().filter(function (cell) {
    return cell.isNode();
  });
};
export var getSelectedEdges = function getSelectedEdges(flowGraph) {
  return flowGraph.getSelectedCells().filter(function (cell) {
    return cell.isEdge();
  });
};
export var toSelectedCellsJSON = function toSelectedCellsJSON(flowGraph) {
  var json = flowGraph.toJSON();
  var selectedCells = flowGraph.getSelectedCells();
  return {
    cells: json.cells.filter(function (cell) {
      return selectedCells.find(function (o) {
        return o.id === cell.id;
      });
    })
  };
};